home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / share / i2p / eepsite / jetty.xml < prev   
Encoding:
Extensible Markup Language  |  2012-10-27  |  14.1 KB  |  285 lines

  1. <?xml version="1.0" encoding="UTF-8" ?> 
  2. <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure 1.2//EN" "http://jetty.mortbay.org/configure_1_2.dtd">
  3.  
  4. <!-- ========================================================================= -->
  5. <!-- This file configures the Jetty server.                                    -->
  6. <!-- All changes require a restart of I2P.                                     -->
  7. <!--                                                                           -->
  8. <!-- Commonly changed settings:                                                -->
  9. <!--   * host: Change 127.0.0.1 to 0.0.0.0 in the addListener section          -->
  10. <!--           to access the server directly (bypassing i2p)                   -->
  11. <!--           from other computers.                                           -->
  12. <!--   * port: Default 7658 in the addConnector section                         -->
  13. <!--   * docroot: Change the ResourceBase in the contexts/base-context.xml file -->
  14. <!--           to serve files from a different location.                       -->
  15. <!--   * threads: Raise maximumPoolSize in the ThreadPool section              -->
  16. <!--           if you have a high-traffic site and get a lot of warnings.      -->
  17. <!--   * Uncomment the addWebApplications section to use to enable             -->
  18. <!--           war files placed in the webapps/ dir.                           -->
  19. <!--   * Uncomment the line to allow Jetty to follow symlinks                  -->
  20. <!--                                                                           -->
  21. <!-- I2P uses Jetty 6.1.26. If you need web server features not found          -->
  22. <!-- in Jetty 6, you may install and run Jetty 7 or 8 in a different JVM       -->
  23. <!-- or run any other web server such as Apache. If you do run another web     -->
  24. <!-- server instead, be sure and disable the Jetty 6 server for your           -->
  25. <!-- eepsite on http://127.0.0.1:7657/configclients.jsp .                      -->
  26. <!--                                                                           -->
  27. <!-- Jetty now uses the I2P logging system rather than wrapper.log.            -->
  28. <!-- Use the log override org.mortbay.jetty.Server to adjust the log level.    -->
  29. <!--                                                                           -->
  30. <!-- Note that the XML encoding for this file is UTF-8.                        -->
  31. <!--                                                                           -->
  32. <!-- If you have a 'split' directory installation, with configuration          -->
  33. <!-- files in ~/.i2p (Linux) or %APPDATA%\I2P (Windows), be sure to            -->
  34. <!-- edit the file in the configuration directory, NOT the install directory.  -->
  35. <!--                                                                           -->
  36. <!-- ========================================================================= -->
  37.  
  38. <!-- =============================================================== -->
  39. <!-- Configure the Jetty Server                                      -->
  40. <!--                                                                 -->
  41. <!-- Documentation of this file format can be found at:              -->
  42. <!-- http://docs.codehaus.org/display/JETTY/jetty.xml                -->
  43. <!--                                                                 -->
  44. <!-- =============================================================== -->
  45.  
  46.  
  47. <Configure id="Server" class="org.mortbay.jetty.Server">
  48.  
  49.     <!-- =========================================================== -->
  50.     <!-- Server Thread Pool                                          -->
  51.     <!-- =========================================================== -->
  52.     <Set name="ThreadPool">
  53.  
  54.       <!-- PICK ONE -->
  55.  
  56.       <!-- If you don't have or want threadpool
  57.            Requests above the max will be queued
  58.        -->
  59.      <!--
  60.       <New class="org.mortbay.thread.QueuedThreadPool">
  61.         <Set name="minThreads">1</Set>
  62.         <Set name="maxThreads">16</Set>
  63.         <Set name="lowThreads">2</Set>
  64.       </New>
  65.      -->
  66.  
  67.       <!-- Optional Java 5 bounded threadpool with job queue 
  68.            Requests above the max will be rejected and logged.
  69.            High-traffic sites should increase maximumPoolSize.
  70.            TODO: would be nice to use the 5-arg constructor but
  71.                  how do you use an Enum as the TimeUnit argument?
  72.            Alternatively, make a custom class where we can
  73.            set the thread name, set daemon, etc.
  74.            See RouterConsoleRunner.
  75.        -->
  76.       <New class="org.mortbay.thread.concurrent.ThreadPool">
  77.         <Arg type="int">0</Arg>
  78.         <Set name="corePoolSize">1</Set>
  79.         <Set name="maximumPoolSize">24</Set>
  80.       </New>
  81.     </Set>
  82.  
  83.  
  84.  
  85.     <!-- =========================================================== -->
  86.     <!-- Set connectors                                              -->
  87.     <!-- =========================================================== -->
  88.     <!-- One of each type!                                           -->
  89.     <!-- =========================================================== -->
  90.  
  91.     <!-- Use this connector for many frequently idle connections
  92.          and for threadless continuations.
  93.          Not recommended on Java 5 - comment this out, and uncomment the
  94.          SocketConnector below.
  95.          Do not use for gij or JamVM - comment this out, and uncomment the
  96.          SocketConnector below.
  97.     -->    
  98.     <Call name="addConnector">
  99.       <Arg>
  100.           <New class="org.mortbay.jetty.nio.SelectChannelConnector">
  101.             <Set name="host">127.0.0.1</Set>
  102.             <Set name="port">7658</Set>
  103.             <Set name="maxIdleTime">60000</Set>
  104.             <Set name="Acceptors">1</Set>
  105.             <Set name="statsOn">false</Set>
  106.             <Set name="confidentialPort">8443</Set>
  107.         <Set name="lowResourcesConnections">5000</Set>
  108.         <Set name="lowResourcesMaxIdleTime">5000</Set>
  109.             <Set name="useDirectBuffers">false</Set>
  110.           </New>
  111.       </Arg>
  112.     </Call>
  113.  
  114.     <!-- Recommended to use this connector on Java 5, as
  115.          Jetty 6 and Java 5 NIO don't play well together.
  116.     -->
  117.     <!--
  118.     <Call name="addConnector">
  119.       <Arg>
  120.           <New class="org.mortbay.jetty.bio.SocketConnector">
  121.             <Set name="host">127.0.0.1</Set>
  122.             <Set name="port">7658</Set>
  123.             <Set name="maxIdleTime">60000</Set>
  124.             <Set name="Acceptors">1</Set>
  125.             <Set name="statsOn">false</Set>
  126.             <Set name="confidentialPort">8443</Set>
  127.           </New>
  128.       </Arg>
  129.     </Call>
  130.     -->
  131.  
  132.     <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  133.     <!-- To add a HTTPS SSL listener                                     -->
  134.     <!-- see jetty-ssl.xml to add an ssl connector. use                  -->
  135.     <!-- To enable this change clients.config args to be:                -->
  136.     <!--                                                                 -->
  137.     <!--   clientApp3.args=etc/jetty.xml etc/jetty-ssl.xml               -->
  138.     <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  139.   <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  140.   <!-- Add a HTTPS SSL listener on port 8443                               -->
  141.   <!--                                                                     -->
  142.   <!-- In the unlikely event you would want SSL support for your eepsite.  -->
  143.   <!-- You would need to generate a selfsigned certificate in a keystore   -->
  144.   <!-- in ~/.i2p/eepsite/keystore.ks, for example with the command line:   -->
  145.   <!--
  146.        keytool -genkey -storetype JKS -keystore ~/.i2p/eepsite/etc/keystore.ks -storepass changeit -alias console -dname CN=xyz123.eepsite.i2p.net,OU=Eepsite,O=I2P Anonymous Network,L=XX,ST=XX,C=XX -validity 3650 -keyalg DSA -keysize 1024 -keypass myKeyPassword 
  147.    -->
  148.   <!-- Change the CN and key password in the example, of course.           -->
  149.   <!-- You wouldn't want to open this up to the regular internet,          -->
  150.   <!-- would you?? Untested and not recommended.                           -->
  151.   <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  152.  
  153.     <!-- =========================================================== -->
  154.     <!-- Set up global session ID manager                            -->
  155.     <!-- =========================================================== -->
  156.     <!--
  157.     <Set name="sessionIdManager">
  158.       <New class="org.mortbay.jetty.servlet.HashSessionIdManager">
  159.         <Set name="workerName">node1</Set>
  160.       </New>
  161.     </Set>
  162.     -->
  163.  
  164.     <!-- =========================================================== -->
  165.     <!-- Set handler Collection Structure                            --> 
  166.     <!-- =========================================================== -->
  167.     <Set name="handler">
  168.       <New id="Handlers" class="org.mortbay.jetty.handler.HandlerCollection">
  169.         <Set name="handlers">
  170.          <Array type="org.mortbay.jetty.Handler">
  171.            <Item>
  172.              <New id="Contexts" class="org.mortbay.jetty.handler.ContextHandlerCollection"/>
  173.            </Item>
  174.            <Item>
  175.              <New id="DefaultHandler" class="org.mortbay.jetty.handler.DefaultHandler"/>
  176.            </Item>
  177.            <Item>
  178.              <New id="RequestLog" class="org.mortbay.jetty.handler.RequestLogHandler"/>
  179.            </Item>
  180.          </Array>
  181.         </Set>
  182.       </New>
  183.     </Set>
  184.     
  185.     <!-- =========================================================== -->
  186.     <!-- Configure the context deployer                              -->
  187.     <!-- A context deployer will deploy contexts described in        -->
  188.     <!-- configuration files discovered in a directory.              -->
  189.     <!-- The configuration directory can be scanned for hot          -->
  190.     <!-- deployments at the configured scanInterval.                 -->
  191.     <!--                                                             -->
  192.     <!-- This deployer is configured to deploy contexts configured   -->
  193.     <!-- in the $JETTY_HOME/contexts directory                       -->
  194.     <!--                                                             -->
  195.     <!-- =========================================================== -->
  196.     <Call name="addLifeCycle">
  197.       <Arg>
  198.         <New class="org.mortbay.jetty.deployer.ContextDeployer">
  199.           <Set name="contexts"><Ref id="Contexts"/></Set>
  200.           <Set name="configurationDir">./eepsite/contexts</Set>
  201.           <!-- set to 60 to have it check for changes once a minute -->
  202.           <Set name="scanInterval">0</Set>
  203.         </New>
  204.       </Arg>
  205.     </Call>
  206.  
  207.     <!-- =========================================================== -->
  208.     <!-- Configure the webapp deployer.                              -->
  209.     <!-- A webapp  deployer will deploy standard webapps discovered  -->
  210.     <!-- in a directory at startup, without the need for additional  -->
  211.     <!-- configuration files.    It does not support hot deploy or   -->
  212.     <!-- non standard contexts (see ContextDeployer above).          -->
  213.     <!--                                                             -->
  214.     <!-- This deployer is configured to deploy webapps from the      -->
  215.     <!-- $JETTY_HOME/webapps directory                               -->
  216.     <!--                                                             -->
  217.     <!-- Normally only one type of deployer need be used.            -->
  218.     <!--                                                             -->
  219.     <!-- =========================================================== -->
  220.     <Call name="addLifeCycle">
  221.       <Arg>
  222.         <New class="org.mortbay.jetty.deployer.WebAppDeployer">
  223.           <Set name="contexts"><Ref id="Contexts"/></Set>
  224.           <Set name="webAppDir">./eepsite/webapps</Set>
  225.       <Set name="parentLoaderPriority">false</Set>
  226.           <!-- set to true if you have uncompiled jsps in your wars -->
  227.       <Set name="extract">false</Set>
  228.       <Set name="allowDuplicates">false</Set>
  229.           <Set name="defaultsDescriptor">./eepsite/etc/webdefault.xml</Set>
  230.         </New>
  231.       </Arg>
  232.     </Call>
  233.  
  234.     <!-- =========================================================== -->
  235.     <!-- Configure Authentication Realms                             -->
  236.     <!-- Realms may be configured for the entire server here, or     -->
  237.     <!-- they can be configured for a specific web app in a context  -->
  238.     <!-- configuration (see $(jetty.home)/contexts/test.xml for an   -->
  239.     <!-- example).                                                   -->
  240.     <!-- =========================================================== -->
  241.   <!-- UNCOMMENT TO ACTIVATE
  242.     <Set name="UserRealms">
  243.       <Array type="org.mortbay.jetty.security.UserRealm">
  244.         <Item>
  245.           <New class="org.mortbay.jetty.security.HashUserRealm">
  246.             <Set name="name">Test Realm</Set>
  247.             <Set name="config">./eepsite/etc/realm.properties</Set>
  248.             <Set name="refreshInterval">0</Set>
  249.           </New>
  250.         </Item>
  251.       </Array>
  252.     </Set>
  253.   -->
  254.  
  255.     <!-- =========================================================== -->
  256.     <!-- Configure Request Log                                       -->
  257.     <!-- Request logs  may be configured for the entire server here, -->
  258.     <!-- or they can be configured for a specific web app in a       -->
  259.     <!-- contexts configuration (see $(jetty.home)/contexts/test.xml -->
  260.     <!-- for an example).                                            -->
  261.     <!-- =========================================================== -->
  262.     <Ref id="RequestLog">
  263.       <Set name="requestLog">
  264.         <New id="RequestLogImpl" class="net.i2p.jetty.I2PRequestLog">
  265.           <Set name="filename">./eepsite/logs/yyyy_mm_dd.request.log</Set>
  266.           <Set name="filenameDateFormat">yyyy_MM_dd</Set>
  267.           <Set name="retainDays">90</Set>
  268.           <Set name="append">true</Set>
  269.           <Set name="extended">false</Set>
  270.           <Set name="logCookies">false</Set>
  271.           <Set name="LogTimeZone">GMT</Set>
  272.         </New>
  273.       </Set>
  274.     </Ref>
  275.  
  276.     <!-- =========================================================== -->
  277.     <!-- extra options                                               -->
  278.     <!-- =========================================================== -->
  279.     <Set name="stopAtShutdown">true</Set>
  280.     <Set name="sendServerVersion">false</Set>
  281.     <Set name="sendDateHeader">true</Set>
  282.     <Set name="gracefulShutdown">1000</Set>
  283.  
  284. </Configure>
  285.